
var classes = {'btn': true, 'active': true};
var foo = 'bar';
classes['btn-' + foo] = true;
<button class=classes>Click me</button>
